clear

use "~/final_dataset.dta"


******Figure 3 Time trends

set more off
regress institutional_torture_dum i.year_arrest i.Ent_arrest, r
margins  i.year_arrest, atmeans post
#delimit;
coefplot, vertical  keep(1989.year_arrest 1990.year_arrest  1991.year_arrest 1992.year_arrest 1993.year_arrest 1994.year_arrest  //
1995.year_arrest 1996.year_arrest 1997.year_arrest 1998.year_arrest 1999.year_arrest 2000.year_arrest 2001.year_arrest 2002.year_arrest 2003.year_arrest 2004.year_arrest 2005.year_arrest 2006.year_arrest 2007.year_arrest 2008.year_arrest //
2009.year_arrest 2010.year_arrest 2011.year_arrest 2012.year_arrest 2013.year_arrest 2014.year_arrest 2015.year_arrest 2016.year_arrest) xline(12)  xline(18) xline(26, lpattern(dash))  recast(line) lwidth(*1.3) lcolor(black) ciopts(recast(rline) lpattern(shortdash_dot) color(black*.7%10%))  //  
coeflabels(1989.year_arrest ="1989" 1990.year_arrest ="1990" 1991.year_arrest ="1991" 1992.year_arrest ="1992" 1993.year_arrest ="1993" 1994.year_arrest ="1994" //
1995.year_arrest ="1995" 1996.year_arrest ="1996" 1997.year_arrest ="1997" 1998.year_arrest ="1998" 1999.year_arrest ="1999" 2000.year_arrest ="2000" 2001.year_arrest ="2001"  2002.year_arrest ="2002" 2003.year_arrest ="2003" 2004.year_arrest ="2004" 2005.year_arrest ="2005" 2006.year_arrest ="2006" 2007.year_arrest ="2007" 2008.year_arrest ="2008"//
2009.year_arrest ="2009" 2010.year_arrest ="2010"  2011.year_arrest ="2011" 2012.year_arrest ="2012" 2013.year_arrest ="2013" 2014.year_arrest ="2014" 2015.year_arrest ="2015" 2016.year_arrest ="2016") 
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) 
xlabel(, angle(vertical) labsize(small))  
xtitle(Torture, size(medium)) 
ylabel(, labsize(small)) 
name(institutional_torture_dum, replace)
;

********** Total brute
set more off
regress brute_force_dum  i.year_arrest i.Ent_arrest, r
margins  i.year_arrest , atmeans post
#delimit ;
coefplot, vertical  keep(1989.year_arrest 1990.year_arrest  1991.year_arrest 1992.year_arrest 1993.year_arrest 1994.year_arrest  //
1995.year_arrest 1996.year_arrest 1997.year_arrest 1998.year_arrest 1999.year_arrest 2000.year_arrest 2001.year_arrest 2002.year_arrest 2003.year_arrest 2004.year_arrest 2005.year_arrest 2006.year_arrest 2007.year_arrest 2008.year_arrest //
2009.year_arrest 2010.year_arrest 2011.year_arrest 2012.year_arrest 2013.year_arrest 2014.year_arrest 2015.year_arrest 2016.year_arrest)  xline(12)  xline(18) xline(26, lpattern(dash)) recast(line) lwidth(*1.3) lcolor(black) ciopts(recast(rline) lpattern(shortdash_dot) color(black*.7%10))  //  
coeflabels(1989.year_arrest ="1989" 1990.year_arrest ="1990" 1991.year_arrest ="1991" 1992.year_arrest ="1992" 1993.year_arrest ="1993" 1994.year_arrest ="1994" //
1995.year_arrest ="1995" 1996.year_arrest ="1996" 1997.year_arrest ="1997" 1998.year_arrest ="1998" 1999.year_arrest ="1999" 2000.year_arrest ="2000" 2001.year_arrest ="2001"  2002.year_arrest ="2002" 2003.year_arrest ="2003" 2004.year_arrest ="2004" 2005.year_arrest ="2005" 2006.year_arrest ="2006" 2007.year_arrest ="2007" 2008.year_arrest ="2008"//
2009.year_arrest ="2009" 2010.year_arrest ="2010"  2011.year_arrest ="2011" 2012.year_arrest ="2012" 2013.year_arrest ="2013" 2014.year_arrest ="2014" 2015.year_arrest ="2015" 2016.year_arrest ="2016") 
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))
xlabel(, angle(vertical) labsize(small)) 
xtitle(Brute force, size(medium)) 
ylabel(, labsize(small)) 
name(brute_force_dum, replace)
;

****** total threats

set more off
regress threats_dum i.year_arrest i.Ent_arrest, r 
margins  i.year_arrest , atmeans post
#delimit ;
coefplot, vertical  keep(1989.year_arrest 1990.year_arrest  1991.year_arrest 1992.year_arrest 1993.year_arrest 1994.year_arrest  //
1995.year_arrest 1996.year_arrest 1997.year_arrest 1998.year_arrest 1999.year_arrest 2000.year_arrest 2001.year_arrest 2002.year_arrest 2003.year_arrest 2004.year_arrest 2005.year_arrest 2006.year_arrest 2007.year_arrest 2008.year_arrest //
2009.year_arrest 2010.year_arrest 2011.year_arrest 2012.year_arrest 2013.year_arrest 2014.year_arrest 2015.year_arrest 2016.year_arrest)  xline(12)  xline(18) xline(26, lpattern(dash)) recast(line) lwidth(*1.3) lcolor(black) ciopts(recast(rline) lpattern(shortdash_dot) color(black*.7%10))  //  
coeflabels(1989.year_arrest ="1989" 1990.year_arrest ="1990" 1991.year_arrest ="1991" 1992.year_arrest ="1992" 1993.year_arrest ="1993" 1994.year_arrest ="1994" //
1995.year_arrest ="1995" 1996.year_arrest ="1996" 1997.year_arrest ="1997" 1998.year_arrest ="1998" 1999.year_arrest ="1999" 2000.year_arrest ="2000" 2001.year_arrest ="2001"  2002.year_arrest ="2002" 2003.year_arrest ="2003" 2004.year_arrest ="2004" 2005.year_arrest ="2005" 2006.year_arrest ="2006" 2007.year_arrest ="2007" 2008.year_arrest ="2008"//
2009.year_arrest ="2009" 2010.year_arrest ="2010"  2011.year_arrest ="2011" 2012.year_arrest ="2012" 2013.year_arrest ="2013" 2014.year_arrest ="2014" 2015.year_arrest ="2015" 2016.year_arrest ="2016") 
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))
xlabel(, angle(vertical) labsize(small)) 
xtitle(Threats, size(medium)) 
ylabel(, labsize(small)) 
name(threats_dum, replace)
;
***********

#delimit ;
graph combine  institutional_torture_dum brute_force_dum threats_dum, 
cols(3) rows(1)  commonscheme imargin(0 0 0 0) 
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))
name(gcomm, replace)
ycommon
ysize(3) xsize(7)
;
**********************************
******* Efects of reform********
***** 

***TABLE SIX***

eststo clear 
set more off
eststo: regress institutional_torture_dum  i.allreform_with_fed  i.Sex i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.Ent_arrest, vce(cluster group_id) 
eststo:  regress brute_force_dum i.allreform_with_fed   i.Sex i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.Ent_arrest, vce(cluster group_id) 
eststo: regress  threats_dum i.allreform_with_fed  i.Sex i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.Ent_arrest, vce(cluster group_id) 
eststo: regress institutional_torture_dum  i.allreform_with_fed  i.Sex i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.group_id, vce(cluster group_id) 
eststo: regress brute_force_dum i.allreform_with_fed   i.Sex i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.group_id,  vce(cluster group_id) 
eststo: regress  threats_dum i.allreform_with_fed  i.Sex i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.group_id, vce(cluster group_id) 
eststo: regress institutional_torture_dum  i.allreform_with_fed  i.Sex i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.clave, vce(cluster group_id) 
eststo: regress brute_force_dum i.allreform_with_fed  i.Sex i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.clave, vce(cluster group_id) 
eststo: regress  threats_dum i.allreform_with_fed   i.Sex i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.clave, vce(cluster group_id) 




**********Confounding factors 
*generate leads and lags 
generate fac =.

replace fac = 0 if prior_lead19 == 1 
replace fac = 1 if lead_18 == 1 
replace fac = 2 if lead_17 == 1 
replace fac = 3 if lead_16 ==1
replace fac = 4 if lead_15 ==1
replace fac = 5 if lead_14 ==1
replace fac = 6 if lead_13 ==1
replace fac = 7 if lead_12 ==1
replace fac = 8 if lead_11 ==1
replace fac = 8 if lead_10 ==1
replace fac = 10 if lead_9 ==1
replace fac = 11 if lead_8 ==1
replace fac = 12 if lead_7 ==1
replace fac = 13 if lead_6 ==1
replace fac = 14 if lead_5 ==1
replace fac = 15 if lead_4 ==1
replace fac = 16 if lead_3 ==1
replace fac = 17 if lead_2 ==1
replace fac = 18 if lead_1 ==1
replace fac = 19 if  leads_lags == "Implementation"
replace fac = 20 if  lag_1 ==1
replace fac = 21 if  lag_2 ==1
replace fac = 22 if  lag_3 ==1
replace fac = 23 if  lag_4 ==1
replace fac = 24 if  lag_5 ==1
replace fac = 25 if  lag_6 ==1
replace fac = 26 if  lag_7 ==1
replace fac = 27 if  lag_8 ==1
replace fac = 28 if  lag_9 ==1
replace fac = 29 if  lag_10 ==1
replace fac = 30 if  lag_11==1
replace fac = 31 if  lag_12==1
replace fac = 32 if  lag_13==1
replace fac = 33 if  lag_14==1
replace fac = 34 if  lag_15==1
replace fac = 35 if  lag_16==1
replace fac = 36 if  lag_17==1
replace fac =37 if lag_18==1
replace fac = 38 if post_lag19 == 1 

label define nuevofac 0."Prior" 1."-18m" 2."-17m" 3."-16m" 4."-15m"  5."-14m" 6."-13m" 7."-12m" 8."-11m" 9."-10" 10."-9m" 11."-8m" 12."-7m" 13."-6m" 14."-5m" 15."-4m" 16."-3m" 17."-2m" 18."-1m" 19."Reform" 20."+1m" 21."+2m" 22."+3m" 23."+4m" 24."+5m" 25."+6m" 26."+7m" 27."+8m" 28."+9m" 29."+10m" 30."+11m" 31."+12m" 32."+13m" 33."+14m" 34."+15m" 35."+16m" 36."+17m" 37."+18m" 38."Post 18m" 

label values fac nuevofac

**************


set more off
regress theft i.fac i.clave i.year_month, vce(cluster group_id) 

#delimit;
coefplot, vertical  keep(7.fac 8.fac 9.fac 10.fac 11.fac 12.fac 13.fac 14.fac 15.fac 16.fac 17.fac 18.fac 19.fac 20.fac 21.fac 22.fac 23.fac 24.fac 25.fac 26.fac 27.fac 28.fac 29.fac 30.fac 31.fac) recast(line) lwidth(.4) lcolor(black) ciopts(recast(rline) lpattern(shortdash_dot) color(black*.5%10))  xline(12) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) 
xlabel(, angle(vertical) labsize(tiny))  
xtitle(Theft, size(medium)) 
ylabel(, labsize(small)) 
name(theft, replace)
;
#delimit cr
graph close

set more off
regress homicide i.fac  i.clave i.year_month, vce(cluster group_id) 
#delimit;
coefplot, vertical  keep(7.fac 8.fac 9.fac 10.fac 11.fac 12.fac 13.fac 14.fac 15.fac 16.fac 17.fac 18.fac 19.fac 20.fac 21.fac 22.fac 23.fac 24.fac 25.fac 26.fac 27.fac 28.fac 29.fac 30.fac 31.fac) recast(line) lwidth(.4) lcolor(black) ciopts(recast(rline) lpattern(shortdash_dot) color(black*.5%10))  xline(12) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) 
xlabel(, angle(vertical) labsize(tiny))  
xtitle(Homicide, size(medium)) 
ylabel(, labsize(small)) 
name(homicide, replace)
;
#delimit cr
graph close

set more off
regress kidnap i.fac  i.clave i.year_month, vce(cluster group_id) 
#delimit;
coefplot, vertical  keep(7.fac 8.fac 9.fac 10.fac 11.fac 12.fac 13.fac 14.fac 15.fac 16.fac 17.fac 18.fac 19.fac 20.fac 21.fac 22.fac 23.fac 24.fac 25.fac 26.fac 27.fac 28.fac 29.fac 30.fac 31.fac) recast(line) lwidth(.4) lcolor(black) ciopts(recast(rline) lpattern(shortdash_dot) color(black*.5%10))  xline(12) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) 
xlabel(, angle(vertical) labsize(tiny))  
xtitle(Kidnap, size(medium)) 
ylabel(, labsize(small)) 
name(kidnap, replace)
;
#delimit cr
graph close

set more off
regress illegal_weapons i.fac  i.clave i.year_month, vce(cluster group_id) 

#delimit;
coefplot, vertical  keep(7.fac 8.fac 9.fac 10.fac 11.fac 12.fac 13.fac 14.fac 15.fac 16.fac 17.fac 18.fac 19.fac 20.fac 21.fac 22.fac 23.fac 24.fac 25.fac 26.fac 27.fac 28.fac 29.fac 30.fac 31.fac) recast(line) lwidth(.4) lcolor(black) ciopts(recast(rline) lpattern(shortdash_dot) color(black*.5%10))  xline(12) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) 
xlabel(, angle(vertical) labsize(tiny))  
xtitle(Illegal weapons, size(medium)) 
ylabel(, labsize(small)) 
name(weapon, replace)
;
#delimit cr


****************Effects on authority
gen Authority2 = P3_2

recode Authority2  5=5 6=5 1=1 2=2 3=3 4=4 7=0 8=0 98=. 99=.

label define Authority2 0."Other" 1."Municipal Police" 2."State Police" 3."Federal Police" 4."Judicial Police" 5."Army or Navy" 
label values Authority2 Authority2
gen municipal = Authority2
recode municipal 1=1 *=0

gen state =Authority2
recode state 2=1 *=0

gen ministerial = Authority2
recode ministerial 4=1 *=0

gen federal =Authority2
recode federal 3=1 *=0
gen army = Authority2
recode army = 5

set more off
regress municipal i.fac i.Mun_arrest i.clave i.year_month, vce(cluster group_id) 

#delimit;
coefplot, vertical  keep(7.fac 8.fac 9.fac 10.fac 11.fac 12.fac 13.fac 14.fac 15.fac 16.fac 17.fac 18.fac 19.fac 20.fac 21.fac 22.fac 23.fac 24.fac 25.fac 26.fac 27.fac 28.fac 29.fac 30.fac 31.fac) recast(line) lwidth(.4) lcolor(black) ciopts(recast(rline) lpattern(shortdash_dot) color(black*.5%10))  xline(12) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) 
xlabel(, angle(vertical) labsize(tiny))  
xtitle(Municipal Police, size(medium)) 
ylabel(, labsize(small)) 
name(muni2, replace)
;
#delimit cr
graph close


set more off
regress state i.fac i.Ent_arrest i.year_month, vce(cluster group_id) 

#delimit;
coefplot, vertical  keep(7.fac 8.fac 9.fac 10.fac 11.fac 12.fac 13.fac 14.fac 15.fac 16.fac 17.fac 18.fac 19.fac 20.fac 21.fac 22.fac 23.fac 24.fac 25.fac 26.fac 27.fac 28.fac 29.fac 30.fac 31.fac) recast(line) lwidth(.4) lcolor(black) ciopts(recast(rline) lpattern(shortdash_dot) color(black*.5%10))  xline(12) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) 
xlabel(, angle(vertical) labsize(tiny))  
xtitle(State Police, size(medium)) 
ylabel(, labsize(small)) 
name(state, replace)
;
#delimit cr
graph close


set more off
regress ministerial i.fac  i.Ent_arrest i.year_month, vce(cluster group_id) 

#delimit;
coefplot, vertical  keep(7.fac 8.fac 9.fac 10.fac 11.fac 12.fac 13.fac 14.fac 15.fac 16.fac 17.fac 18.fac 19.fac 20.fac 21.fac 22.fac 23.fac 24.fac 25.fac 26.fac 27.fac 28.fac 29.fac 30.fac 31.fac) recast(line) lwidth(.4) lcolor(black) ciopts(recast(rline) lpattern(shortdash_dot) color(black*.5%10))  xline(12) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) 
xlabel(, angle(vertical) labsize(tiny))  
xtitle(Ministerial Police, size(medium)) 
ylabel(, labsize(small)) 
name(mini, replace)
;

#delimit cr
graph close


set more off
regress federal i.fac i.Ent_arrest i.year_month, vce(cluster group_id) 

#delimit;
coefplot, vertical  keep(7.fac 8.fac 9.fac 10.fac 11.fac 12.fac 13.fac 14.fac 15.fac 16.fac 17.fac 18.fac 19.fac 20.fac 21.fac 22.fac 23.fac 24.fac 25.fac 26.fac 27.fac 28.fac 29.fac 30.fac 31.fac) recast(line) lwidth(.4) lcolor(black) ciopts(recast(rline) lpattern(shortdash_dot) color(black*.5%10))  xline(12) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) 
xlabel(, angle(vertical) labsize(tiny))  
xtitle(Federal Police, size(medium)) 
ylabel(, labsize(small)) 
name(fed, replace)
;
#delimit cr
graph close


set more off
regress army i.fac i.Ent_arrest i.year_month, vce(cluster group_id) 

#delimit;
coefplot, vertical  keep(7.fac 8.fac 9.fac 10.fac 11.fac 12.fac 13.fac 14.fac 15.fac 16.fac 17.fac 18.fac 19.fac 20.fac 21.fac 22.fac 23.fac 24.fac 25.fac 26.fac 27.fac 28.fac 29.fac 30.fac 31.fac) recast(line) lwidth(.4) lcolor(black) ciopts(recast(rline) lpattern(shortdash_dot) color(black*.5%10))  xline(12) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) 
xlabel(, angle(vertical) labsize(tiny))  
xtitle(Army, size(medium)) 
ylabel(, labsize(small)) 
name(army, replace)
;

#delimit cr

#delimit ;
graph combine  theft homicide kidnap weapon muni2 state mini fed army, 
cols(3) rows(3)  commonscheme imargin(0 0 0 0 0) 
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))
name(gcomm, replace)
ycommon
ysize(7) xsize(7)
;
#delimit cr

******************placebo test the reform
****TABLE 8
eststo clear
eststo: regress institutional_torture_dum after_first_pub i.allreform SEXO i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous i.year_arrest i.Ent_arrest, vce(cluster group_id)
eststo: regress brute_force_dum after_first_pub i.allreform SEXO i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.Ent_arrest, vce(cluster group_id)
eststo: regress threat_dum after_first_pub i.allreform SEXO i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.Ent_arrest, vce(cluster group_id)
eststo: regress institutional_torture_dum after_first_pub i.allreform SEXO i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.group_id, vce(cluster group_id)
eststo: regress brute_force_dum after_first_pub i.allreform SEXO i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.group_id, vce(cluster group_id)
eststo: regress threat_dum after_first_pub i.allreform SEXO i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.group_id, vce(cluster group_id)
eststo: regress institutional_torture_dum after_first_pub i.allreform SEXO i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.clave, vce(cluster group_id)
eststo: regress brute_force_dum after_first_pub i.allreform SEXO i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.clave, vce(cluster group_id)
eststo: regress threat_dum after_first_pub i.allreform SEXO i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.clave, vce(cluster group_id)


eststo clear
eststo: regress institutional_torture_dum i.refplacebo SEXO i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous i.year_arrest i.Ent_arrest, vce(cluster group_id)
eststo: regress brute_force_dum i.refplacebo SEXO i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.Ent_arrest, vce(cluster group_id)
eststo: regress threat_dum i.refplacebo SEXO i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.Ent_arrest, vce(cluster group_id)
eststo: regress institutional_torture_dum i.refplacebo SEXO i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.group_id, vce(cluster group_id)
eststo: regress brute_force_dum i.refplacebo SEXO i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.group_id, vce(cluster group_id)
eststo: regress threat_dum i.refplacebo SEXO i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.group_id, vce(cluster group_id)
eststo: regress institutional_torture_dum i.refplacebo SEXO i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.clave, vce(cluster group_id)
eststo: regress brute_force_dum i.refplacebo SEXO i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.clave, vce(cluster group_id)
eststo: regress threat_dum i.refplacebo SEXO i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.clave, vce(cluster group_id)


eststo clear
set more off
eststo: regress institutional_torture_dum i.refplacebo1 SEXO i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous i.year_arrest i.Ent_arrest, vce(cluster group_id)
eststo: regress brute_force_dum i.refplacebo1 SEXO i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.Ent_arrest, vce(cluster group_id)
eststo: regress threat_dum i.refplacebo1 SEXO i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.Ent_arrest, vce(cluster group_id)
eststo: regress institutional_torture_dum i.refplacebo1 SEXO i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.group_id, vce(cluster group_id)
eststo: regress brute_force_dum i.refplacebo1 SEXO i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.group_id, vce(cluster group_id)
eststo: regress threat_dum i.refplacebo1 SEXO i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.group_id, vce(cluster group_id)
eststo: regress institutional_torture_dum i.refplacebo1 SEXO i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.clave, vce(cluster group_id)
eststo: regress brute_force_dum i.refplacebo1 SEXO i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.clave, vce(cluster group_id)
eststo: regress threat_dum i.refplacebo1 SEXO i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.clave, vce(cluster group_id)


eststo clear
set more off
eststo: regress institutional_torture_dum i.refplacebo2 SEXO i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous i.year_arrest i.Ent_arrest, vce(cluster group_id)
eststo: regress brute_force_dum i.refplacebo2 SEXO i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.Ent_arrest, vce(cluster group_id)
eststo: regress threat_dum i.refplacebo2 SEXO i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.Ent_arrest, vce(cluster group_id)
eststo: regress institutional_torture_dum i.refplacebo2 SEXO i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.group_id, vce(cluster group_id)
eststo: regress brute_force_dum i.refplacebo2 SEXO i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.group_id, vce(cluster group_id)
eststo: regress threat_dum i.refplacebo2 SEXO i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.group_id, vce(cluster group_id)
eststo: regress institutional_torture_dum i.refplacebo2 SEXO i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.clave, vce(cluster group_id)
eststo: regress brute_force_dum i.refplacebo2 SEXO i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.clave, vce(cluster group_id)
eststo: regress threat_dum i.refplacebo2 SEXO i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.year_arrest i.clave, vce(cluster group_id)





*****************Drug War effects 
****************
eststo clear 
set more off

eststo: regress institutional_torture_dum d_operacion_conjunta_all i.Sex i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous i.Ent_arrest  i.year_arrest if year_arrest<2013, vce(cluster clave) 
eststo: regress institutional_torture_dum d_operacion_conjunta_all kernel_war i.Sex i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous i.year_arrest i.clave if year_arrest<2013, vce(cluster clave) 
eststo: regress institutional_torture_dum d_operacion_conjunta_all##i.federal_prison i.Sex i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.clave  i.year_arrest if year_arrest<2013, vce(cluster clave) 
eststo: regress institutional_torture_dum d_operacion_conjunta_all##authority2 i.Sex i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous  i.Ent_arrest  i.year_arrest if year_arrest<2013, vce(cluster clave) 


*****************


*******


eststo clear 
eststo: regress institutional_torture_dum d_op_all_pl1_2011  i.Sex i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous i.Ent_arrest  i.year_arrest, vce(cluster clave)
eststo: regress institutional_torture_dum d_op_all_pl2_2011  i.Sex i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous i.Ent_arrest  i.year_arrest, vce(cluster clave)
eststo: regress institutional_torture_dum d_op_all_pl3_2011  i.Sex i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous i.Ent_arrest  i.year_arrest, vce(cluster clave)
eststo: regress brute_force_dum d_op_all_pl1_2011  i.Sex i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous i.Ent_arrest  i.year_arrest, vce(cluster clave)
eststo: regress brute_force_dum d_op_all_pl2_2011  i.Sex i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous i.Ent_arrest  i.year_arrest, vce(cluster clave)
eststo: regress brute_force_dum d_op_all_pl3_2011  i.Sex i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous i.Ent_arrest  i.year_arrest, vce(cluster clave)
eststo: regress threat_dum d_op_all_pl1_2011  i.Sex i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous i.Ent_arrest  i.year_arrest, vce(cluster clave)
eststo: regress threat_dum d_op_all_pl2_2011  i.Sex i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous i.Ent_arrest  i.year_arrest, vce(cluster clave)
eststo: regress threat_dum d_op_all_pl3_2011  i.Sex i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous i.Ent_arrest  i.year_arrest, vce(cluster clave)

*******Heterogeneous effects for reform 


*******************************Heterogeneous reform and organized crime
eststo clear
set more off
eststo: regress institutional_torture_dum i.allreform_with_fed##i.kernel_war  i.Sex i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous i.group_id i.year_arrest, vce(cluster group_id) 
eststo:  regress institutional_torture_dum i.allreform_with_fed##c.hom_totpc  i.Sex i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous i.group_id i.year_arrest, vce(cluster group_id) 
eststo:  regress institutional_torture_dum i.allreform_with_fed##i.crimes1 i.Sex i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous i.group_id i.year_arrest, vce(cluster group_id) 
eststo:  regress institutional_torture_dum i.allreform_with_fed##i.authority2 i.Sex i.occupation i.cat_age i.education i.wealth_cat4 i.noread_write i.indigenous i.group_id i.year_arrest, vce(cluster group_id) 

*************





